<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    [v-clock]{
        display: none;
    }
</style>
<body>
    <div id="app" v-clock>
        <!-- <div>{{info.name}}</div>
        <div>{{info.address}}</div> -->
        <a v-bind:href="info.url">点我</a>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
        var vm = new Vue({
        el:"#app",
        data(){
            // 请求的返回参数必须和json文件格式相同
            return{
                info:{
                    name:123,
                    address:{
                        street:null,
                        city:null,
                        country:null
                    },
                    url:"https://www.baidu.com/"
                }
            }
        },
        // 钩子函数   链式编程。
        mounted(){
            axios.get('data.json').then(response=>(console.log(response.data)))
        }
    });
    </script>
</body>
</html>